package com.qingke.oo;

public class Rectangle extends Shape{
	private double width = 1;
	private double length = 1;
	
	public Rectangle(){
		super();
	}
	
	public Rectangle(double width,double length){
		super();
		this.width = width;
		this.length = length;
	}
	
	public Rectangle(double width,double length,String color,boolean filled){
		super(color,filled);
		this.width = width;
		this.length = length;
	}
	
	public double getWidth(){
		return width;
	}
	
	public void setWidth(double width){
		this.width = width;
	}
	
	public double getLength(){
		return length;
	}
	
	public void setLength(double length){
		this.length = length;
	}
	
	public double getArea(){
		return length*width;
	}
	
	public double getPerimeter(){
		return (length+width)*2;
	}
	
	public String toString(){
		return "width= "+width+",length= "+length;
	}
}
